Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 4 - Printing Messages / Printing Messages Reference
Printing Messages / PostScript Imaging Messages


GXPostScriptQueryPrinter

QuickDraw GX sends the GXPostScriptQueryPrinter message to gather configuration information before imaging begins. You can override the GXPostScriptQueryPrinter message to gather information about the current state of the printer and to synchronize communications with it. Your override of the GXPostScriptQueryPrinter message must match the following formal declaration:

OSErr MyPostScriptQueryPrinter (long *queryResult);
queryResult
On return, specifies the state of the printer, as shown in Table 4-8.
function result
An error code. The value noErr indicates that the operation was successful.
DESCRIPTION
Ater the device connection is opened, QuickDraw GX sends the GXPostScriptQueryPrinter message. This message allows QuickDraw GX to gather information from a printer using two-way synchronous communications. The information gathered from the printer is stored in the desktop printer (DTP) configuration file, which all message handlers can access. The state of the printer is returned in the queryResult parameter. The values that are returned are shown in Table 4-8.
Table 4-8 Constants for PostScript query results
ConstantValueExplanation
gxPrinterOk0The information gathered from the printer is sufficient to initiate imaging of the document. The information is stored in the configuration file.
gxInitializePrinter1The printer has not been initialized by any version of printing software and therefore must be initialized. After initialization, the information in the configuration file is up to date.
gxFilePrinting2The output of QuickDraw GX has been redirected to a file, and no immediate two-way synchronous communications is available with the printing device. QuickDraw GX checks that the required information exists in the configuration file and that it is adequate for imaging the document.
gxResetPrinter128The printer has been initialized with an incompatible version of printing software and therefore must be restarted and initialized. The information in the configuration file is left untouched.

The default implementation of this message verifies whether a communications channel is open to a printer or if the output of the system is being redirected to a file. If the print job is being sent to a printer, the default implementation of GXPostScriptQueryPrinter updates the printer configuration information by querying the printer to determine how much memory and which fonts are available on it. The outcome of this message is that the state of the PostScript imaging system is set up to print the job.

You can override the GXPostScriptQueryPrinter message to obtain information about the device you need to process the current document. You need to override this message if you want to test the state of an add-on hardware device such as a bin feeder.

SPECIAL CONSIDERATIONS
If you override the GXPostScriptQueryPrinter message, you must always forward it to enable the default implementation to return information about the type of connection.

RESULT CODES
gxSegmentLoadFailedErrA required code segment could not be found,
or there was not enough memory to load it.
gxPrUserAbortErrThe user has canceled printing.
The default implementation of the GXPostScriptQueryPrinter message can also return the communications errors that are listed in Table 4-2 on page 4-42.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help